﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using Aga.Controls.Tree;
using OpenComposite.EII.Repository;
using OpenComposite.EII.RepositoryUIs;

namespace OpenComposite.EII.Forms.OrgDesigner
{
	public partial class OrganisationTree : DockContent
	{
		public OrganisationTree()
		{
			InitializeComponent();
		}

		public TreeViewAdv TreeView
		{
			get { return tvAdvOrgUnits; }
		}

		private void tvAdvOrgUnits_KeyUp(object sender, KeyEventArgs e)
		{
			if ( e.KeyCode == Keys.I && e.Alt ) {
				if ( tvAdvOrgUnits.SelectedNode == null ) {
					RepositoryItemNode node = tvAdvOrgUnits.SelectedNode.Tag as RepositoryItemNode;
					Helpers.OpenDebugViewer(node.RepositoryItem as RepositoryItemBase);
				}
			}
		}
	}
}
